import request from "@/utils/request";
import Qs from "qs";

export function listOrder(query) {
  return request({
    method: "get",
    params: {
      _gp: "admin.order",
      _mt: "list",
      ...query
    }
  });
}
export function listOrderNew(query) {
  return request({
    method: "get",
    url: "/web/admin-order/list",
    params: {
      // _gp: 'admin.order',
      // _mt: 'list',
      ...query
    }
  });
}
export function listOrderByDayNew(query) {
  return request({
    method: "get",
    url: "/web/admin-order/statistics/by-day",
    params: {
      // _gp: 'admin.order',
      // _mt: 'list',
      ...query
    }
  });
}
export function listOrderByDayNewWx(query) {
  return request({
    method: "get",
    url: "/web/admin-order/statistics/we-chart/bill",
    params: {
      // _gp: 'admin.order',
      // _mt: 'list',
      ...query
    }
  });
}
export function detailOrder(orderId) {
  return request({
    method: "get",
    params: {
      _gp: "admin.order",
      _mt: "detail",
      orderId
    }
  });
}
export function detailOrderNew(orderId) {
  return request({
    url: "/web/admin-order/detail",
    method: "get",
    params: {
      // _gp: 'admin.order',
      // _mt: 'detail',
      orderNo: orderId
    }
  });
}
export function shipOrder(shipForm) {
  return request({
    method: "post",
    data: Qs.stringify({
      _gp: "admin.order",
      _mt: "ship",
      ...shipForm
    })
  });
}
export function shipOrderNew(shipForm) {
  return request({
    method: "post",
    url: "/web/admin-order/ship",
    data: Qs.stringify({
      // _gp: 'admin.order',
      // _mt: 'ship',
      ...shipForm
    })
  });
}
export function refundOrder(refundForm) {
  return request({
    method: "post",
    data: Qs.stringify({
      _gp: "admin.order",
      _mt: "refund",
      ...refundForm
    })
  });
}
export function refundOrderNew(refundForm) {
  return request({
    method: "post",
    url: "/web/admin-order/refund",
    data: Qs.stringify({
      // _gp: 'admin.order',
      // _mt: 'refund',
      ...refundForm
    })
  });
}
export function getExcelInfo(data) {
  return request({
    method: "post",
    data: Qs.stringify({
      _gp: "admin.order",
      _mt: "queryToExcel",
      ...data
    })
  });
}
export function getExcelInfoNew(data) {
  return request({
    method: "post",
    url: "/web/admin-order/query-to-excel",
    data: Qs.stringify({
      // _gp: 'admin.order',
      // _mt: 'queryToExcel',
      ...data
    })
  });
}
export function getExcelStatistics(data) {
  return request({
    method: "get",
    params: {
      _gp: "admin.order",
      _mt: "statistics",
      ...data
    }
  });
}
export function getExcelStatisticsNew(data) {
  return request({
    url: "/web/admin-order/statistics",
    method: "get",
    params: {
      // _gp: 'admin.order',
      // _mt: 'statistics',
      ...data
    }
  });
}
export function editAdminMono(orderId, level, mono) {
  return request({
    method: "post",
    data: Qs.stringify({
      _gp: "admin.order",
      _mt: "editAdminMono",
      orderId,
      level,
      mono
    })
  });
}
export function editAdminMonoNew(orderId, level, mono) {
  return request({
    url: "/web/admin-order/edit-admin-mono",
    method: "post",
    data: Qs.stringify({
      _gp: "admin.order",
      _mt: "editAdminMono",
      orderId,
      level,
      mono
    })
  });
}
